package com.share.admin.web;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.share.admin.model.db.Dept;
import com.share.admin.service.IDeptService;
import com.share.common.common.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 部门表  前端控制器
 * </p>
 *
 * @author author
 * @since 2022-09-23
 */
@RestController
@RequestMapping("/dept")
public class DeptController {

    @Autowired
    private IDeptService iDeptService;

    /**
     * 获取部门列表
     */
    @RequestMapping("/list")
    public Result list() {
        QueryWrapper<Dept> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("status", 1);//查询启用状态的
        List<Dept> list = iDeptService.list(queryWrapper);
        return Result.success(list);
    }
}
